package com.bjmashibing.system.OSFileIO.io_demo.handlerStream;

import java.io.*;

public class OutputStreamWriterDemo {
    public static void main(String[] args) throws IOException {
        demo1();
    }

    private static void demo1() throws IOException {
        File file = new File("src/Java_IO/io_demo/Resources/abc.txt");
        FileOutputStream outputStream = new FileOutputStream(file);
        OutputStreamWriter outputStreamWriter = new OutputStreamWriter(outputStream,"utf-8");
        outputStreamWriter.write(99);
        outputStreamWriter.write("管大为");
        outputStreamWriter.write("abcdefg",0,5);
        outputStreamWriter.close();
        outputStream.close();

    }
}
